<?php
/*
 * Created by generator
 *
 */

class EdittrancheAge extends Controller {

	function EdittrancheAge(){
		parent::Controller();
		$this->load->model('trancheAge_model');
		$this->load->library('session');
		$this->load->helper('url');
	}


	/**
	 * Affichage des infos
	 */
	public function index($traidtra){
		$model = trancheAge_model::gettrancheAge($this->db, $traidtra);
		$data['trancheage'] = $model;

		$this->load->view('edittrancheage_view',$data);
	}

	/**
	 * Sauvegarde des modifications
	 */
	public function save(){
		// Mise a jour des donnees en base
		$model = new trancheAge_model();
		$model->traidtra = $this->input->post('traidtra');
		$model->tralbnom = $this->input->post('tralbnom'); 
		$model->update($this->db);

		$this->session->set_flashdata('message', 'trancheAge mis a jour');

		redirect('listtrancheages/index'); 
	}
	
}
?>
